#ifndef EXC_SCREEN_H
#define EXC_SCREEN_H

#include <QThread>
#include <QLocalSocket>
#include <QByteArray>

#include <QSqlDatabase>
#include <QSqlQuery>
#include <QSqlQueryModel>
#include <QSqlError>
#include <QDateTime>
#include <QVector>
#include <QQuickWidget>

class ExcQmlModbusInterface;
class ExcRecordDisplayer: public QThread
{
    Q_OBJECT
public:
    ExcRecordDisplayer();

public slots:
    void sl_selectDatabase();
    bool sl_isDatabaseOpen(){return m_fdb.isOpen();}

    void sl_showLoadSettingUI(int recallWhich);
    void sl_fullScreen();

    void sl_settingFinishChart();
    void sl_settingFinishTable();

//protected:
//    virtual void keyPressEvent(QKeyEvent *ev);

private:
    QSqlDatabase m_fdb;
    QQuickWidget *m_quickMainScreen;
    QQuickWidget *m_quickWidgetSetting;

    struct _fdbReadBuf_ {
        QDateTime datetime;
        int channel;
        QVector<int>vec;
    };
    QVector<struct _fdbReadBuf_> m_fdbReadBuf;

};

//#define _SQL_DEBUG_PRINT_
//#define _MODBUS_DEBUG_PRINT_
//#define _MODBUS_DISPLAY

#endif // EXC_SCREEN_H
